﻿using System;
using System.Collections.Generic;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Body : HtmlElement
	{
		public Body() : base(BodyDescription.Instance) { }

		public string OnAfterPrint { get { return this["onafterprint"]; } set { this["onafterprint"] = value; } }
		public string OnBeforePrint { get { return this["onbeforeprint"]; } set { this["onbeforeprint"] = value; } }
		public string OnBeforeUnload { get { return this["onbeforeunload"]; } set { this["onbeforeunload"] = value; } }
		public string OnHashChange { get { return this["onhashchange"]; } set { this["onhashchange"] = value; } }
		public string OnMessage { get { return this["onmessage"]; } set { this["onmessage"] = value; } }
		public string OnOffline { get { return this["onoffline"]; } set { this["onoffline"] = value; } }
		public string OnOnline { get { return this["ononline"]; } set { this["ononline"] = value; } }
		public string OnPageHide { get { return this["onpagehide"]; } set { this["onpagehide"] = value; } }
		public string OnPageShow { get { return this["onpageshow"]; } set { this["onpageshow"] = value; } }
		public string OnPopState { get { return this["onpopstate"]; } set { this["onpopstate"] = value; } }
		public string OnResize { get { return this["onresize"]; } set { this["onresize"] = value; } }
		public string OnStorage { get { return this["onstorage"]; } set { this["onstorage"] = value; } }
		public string OnUnload { get { return this["onunload"]; } set { this["onunload"] = value; } }
	}
	public class BodyDescription : HtmlElementDescription
	{
		public static readonly BodyDescription Instance = new BodyDescription();
		private BodyDescription() : base("body") { }
		public override Type ControlType { get { return typeof(Body); } }
		public override string Description { get { return "body of a document (as opposed to the document’s metadata)."; } }
		public override bool AllowInnerText { get { return true; } }
		public override IEnumerable<HtmlElementDescription> PermittedParents { get { yield return HtmlDescription.Instance; } }
	}
}
